package com.zheng.damo01.作业;

import java.util.ArrayList;
import java.util.Collections;

public class o1 {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"孙悟空","猪八戒","沙和尚","铁扇公主");
        System.out.println(list);
        System.out.println(list.get(3));
        System.out.println(list.size());
        System.out.println(list.remove(2));
        list.set(list.indexOf("猪八戒"),"猪无能");
        System.out.println(list);
    }
}
